package com.zhn.usermanager.poi;

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;

import java.io.FileInputStream;
import java.io.IOException;

public class POIRead {
    public static String outputFile = "E:\\idea_workspace\\j259_ssm_user\\src\\main\\java\\com\\zhn\\usermanager\\poi\\test01.xls";

    public static void main(String[] args) throws IOException {
        FileInputStream fIS = new FileInputStream(outputFile);
        HSSFWorkbook workbook = new HSSFWorkbook(fIS);
        HSSFSheet sheet = workbook.getSheet("第一页");
        HSSFRow row = sheet.getRow(0);
        HSSFCell cell0 = row.getCell(0);
        HSSFCell cell1 = row.getCell(1);
        HSSFCell cell2 = row.getCell(2);

        System.out.println(cell0);
        System.out.println(cell1);
        System.out.println(cell2);      //没有的数据为null

    }
}
